Page({
    data: {
        xPageReady : true
    },

    onLoad: function (options) {
        this.xInit(options.id)
    },
    onShareAppMessage: function () {
      return {
        title: '疼痛久治不愈？还有一招',
        imageUrl: 'https://7633-v3-92ah4-1300208657.tcb.qcloud.la/static/share_all.jpg',
      };
  },
    xInit: async function (id) {
        let that = this

        await wx.cloud.callFunction({
            name: 'user',
            data: {
                action: "detail",
                from_openid: id
            }
        }).then(res => {
            console.log("医生:", res.result)
            that.setData({
                xUserInfo : res.result
            })
        })

        that.setData({
            xPageReady : false
        })
    },
})